#ifndef _DISCRETEINTEGRATOR_H_
#define _DISCRETEINTEGRATOR_H_

#include <stdint.h>

#define HEATCONTROL_DISCRETEINTEGRATOR_INSTANCE_DECLS \
			static int32_t HeatControl_DiscreteIntegrator_sum;

#define HeatControl_DiscreteIntegrator_initialize() \
				HeatControl_DiscreteIntegrator_sum = (0 * 1280 >> 8)

#define HEATCONTROL_DISCRETEINTEGRATOR_LOCAL_DECLS \
				int32_t HeatControl_DiscreteIntegrator_value; \
			int32_t HeatControl_DiscreteIntegrator_inputValue = 0;

#define HeatControl_DiscreteIntegrator_Input_consumeInputValue(value) \
					HeatControl_DiscreteIntegrator_inputValue = ((value) * 25600 >> 8)

#define HeatControl_DiscreteIntegrator_computeOutputValues() \
				HeatControl_DiscreteIntegrator_value = ((HeatControl_DiscreteIntegrator_sum << 8) / 1280)

#define HeatControl_DiscreteIntegrator_Output_getOutputValue() \
					HeatControl_DiscreteIntegrator_value

#define HeatControl_DiscreteIntegrator_update() \
			HeatControl_DiscreteIntegrator_sum = (HeatControl_DiscreteIntegrator_sum + HeatControl_DiscreteIntegrator_inputValue)

#endif /* _DISCRETEINTEGRATOR_H_ */
